#随机生成trace
from ast import operator
import random

fd = open("trace","w")
line_limit = 10000
time_limit = 10000000 #the most time once stride
current_time = 0
lpn_limit = 9999999
read_count_limit = 20 #一个请求最多请求多少个块
operation_base = 0 #操作的起始编号
operation = 4

for i in range(line_limit):
    line = ""

    current_time += random.randint(0,time_limit)
    line += str(current_time)
    line += " 0 "

    lpn = random.randint(0,lpn_limit)
    line += str(lpn)
    line += " "
    
    read_count = random.randint(1,read_count_limit)
    line += str(read_count)
    line += " "

    ope = random.randint(operation_base,operation)
    line += str(ope)
    line += " \n"

    fd.write(line)

fd.close()